package com.kaibes.module.token.pojo;

import java.io.Serializable;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
CREATE TABLE `token` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` integer DEFAULT NULL,
  `type` enum('WEB','PC','MAC','ANDROID','IPHONE', 'POSTMAN') NOT NULL,
  `aes_key` varchar(32),
  `aes_iv` varchar(32),
  `expiration` datetime NOT NULL,
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_type` (`user_id`,`type`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 */
@SuppressWarnings("serial")
public class Token implements Serializable {
    
    private BigInteger id;
    private Integer userId;
    private TokenType type;
    private String aesKey;
    private String aesIv;
    private LocalDateTime createTime;
    private LocalDateTime expiration;
    
    public BigInteger getId() {
        return id;
    }
    public void setId(BigInteger id) {
        this.id = id;
    }
    public Integer getUserId() {
        return userId;
    }
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public TokenType getType() {
        return type;
    }
    public void setType(TokenType type) {
        this.type = type;
    }
    public String getAesKey() {
        return aesKey;
    }
    public void setAesKey(String aesKey) {
        this.aesKey = aesKey;
    }
    public String getAesIv() {
        return aesIv;
    }
    public void setAesIv(String aesIv) {
        this.aesIv = aesIv;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public LocalDateTime getExpiration() {
        return expiration;
    }
    public void setExpiration(LocalDateTime expiration) {
        this.expiration = expiration;
    }
    
}
